package com.amos.mqserver.pojo;

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.util.Date;

/**
 * @author liangh on 2018/9/12 0012.
 */
public class MqMessage implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 消息标识ID
     */
    @JSONField(name = "message_id")
    private String messageId;

    /**
     * 消息体
     */
    @JSONField(name = "message_body")
    private String messageBody;

    /**
     * 交换机类型
     */
    @JSONField(name = "exchange_type")
    private String exchangeType;

    /**
     * 交换机名称
     */
    @JSONField(name = "exchange_name")
    private String exchangeName;

    /**
     * 队列名称
     */
    @JSONField(name = "queue_name")
    private String queueName;

    /**
     * 路由键
     */
    @JSONField(name = "route_key")
    private String routeKey;

    /**
     * 消息优先级
     * @return
     */
    @JSONField(name = "message_priority")
    private Integer messagePriority;

    /**
     * 消息状态
     * 1：未确认confirm
     * 2：发送失败，补偿中
     * 3：补偿失败
     * 4：发送成功，确认confirm
     */
    @JSONField(name = "message_status")
    private String messageStatus;

    /**
     * 补偿次数
     */
    @JSONField(name = "try_num")
    private Integer tryNum;

    /**
     * 发送端错误原因
     */
    @JSONField(name = "send_error")
    private String sendError;

    /**
     * 接收端错误原因
     */
    @JSONField(name = "receive_error")
    private String receiveError;

    /**
     * 消息顺序
     */
    private Integer msgOrder;

    /**
     * 队列优先级
     */
    private Integer queuePriority;

    /**
     * 创建时间
     */
    private Date cretime;

    /**
     * 修改时间
     */
    private Date modtime;

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getMessageBody() {
        return messageBody;
    }

    public void setMessageBody(String messageBody) {
        this.messageBody = messageBody;
    }

    public String getExchangeName() {
        return exchangeName;
    }

    public void setExchangeName(String exchangeName) {
        this.exchangeName = exchangeName;
    }

    public String getQueueName() {
        return queueName;
    }

    public void setQueueName(String queueName) {
        this.queueName = queueName;
    }

    public String getRouteKey() {
        return routeKey;
    }

    public void setRouteKey(String routeKey) {
        this.routeKey = routeKey;
    }

    public String getExchangeType() {
        return exchangeType;
    }

    public void setExchangeType(String exchangeType) {
        this.exchangeType = exchangeType;
    }

    public Integer getMessagePriority() {
        return messagePriority;
    }

    public void setMessagePriority(Integer messagePriority) {
        this.messagePriority = messagePriority;
    }

    public String getMessageStatus() {
        return messageStatus;
    }

    public void setMessageStatus(String messageStatus) {
        this.messageStatus = messageStatus;
    }

    public Integer getTryNum() {
        return tryNum;
    }

    public void setTryNum(Integer tryNum) {
        this.tryNum = tryNum;
    }

    public Date getCretime() {
        return cretime;
    }

    public void setCretime(Date cretime) {
        this.cretime = cretime;
    }

    public Date getModtime() {
        return modtime;
    }

    public void setModtime(Date modtime) {
        this.modtime = modtime;
    }

    public Integer getMsgOrder() {
        return msgOrder;
    }

    public void setMsgOrder(Integer msgOrder) {
        this.msgOrder = msgOrder;
    }

    public Integer getQueuePriority() {
        return queuePriority;
    }

    public void setQueuePriority(Integer queuePriority) {
        this.queuePriority = queuePriority;
    }

    public String getSendError() {
        return sendError;
    }

    public void setSendError(String sendError) {
        this.sendError = sendError;
    }

    public String getReceiveError() {
        return receiveError;
    }

    public void setReceiveError(String receiveError) {
        this.receiveError = receiveError;
    }

    @Override
    public String toString() {
        return "MqMessage{" +
                "messageId='" + messageId + '\'' +
                ", messageBody='" + messageBody + '\'' +
                ", exchangeType='" + exchangeType + '\'' +
                ", exchangeName='" + exchangeName + '\'' +
                ", queueName='" + queueName + '\'' +
                ", routeKey='" + routeKey + '\'' +
                ", messagePriority=" + messagePriority +
                ", messageStatus='" + messageStatus + '\'' +
                ", tryNum=" + tryNum +
                ", sendError='" + sendError + '\'' +
                ", receiveError='" + receiveError + '\'' +
                ", msgOrder=" + msgOrder +
                ", queuePriority=" + queuePriority +
                ", cretime=" + cretime +
                ", modtime=" + modtime +
                '}';
    }
}
